﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Function
{   
        public class Book
        {
            public int id;

            public string title;

            public int _price;
            public int Id
            {
                get
                {
                    return id;
                }
                set
                {
                    id = value;
                }
            }
            public string Title
            {
                get
                {
                    return title;
                }
                set
                {
                    title = value;
                }
            }
            public int Price
            {
                get
                {
                    return _price;
                }
                set
                {
                    if (value >= 1 && value <= 100)
                    {
                        _price = value;
                    }
                    else
                    {
                        _price = 0;
                    }
                }
            }

            public void PrintBookInfo()
            {
                Console.WriteLine("书的编号:{0} 书名:{1} 书的价格:{2}", this.id, this.title, this._price);
            }


            ~Book()
            {
                Console.WriteLine("不要998！不要888！只要88！", Title);
            }
        }
    }



